package com.google.code.sip.ucenter.model;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import com.google.code.morphia.annotations.Entity;
import com.google.code.morphia.annotations.Property;
import com.google.code.morphia.annotations.Reference;
import com.google.code.sip.core.utils.ReflectionUtils;

@Entity(noClassnameStored = true)
@SuppressWarnings("serial")
public class UserProfile extends BaseEntity {
	/**
	 * 用户
	 */
	@Reference
	private User user;

	/**
	 * 全名/姓名
	 */
	private String fullName;

	/**
	 * 性别,Male:男，Female,女，Unspecified，未指定
	 */
	private Gender gender = Gender.Unspecified;

	/**
	 * 生日
	 */
	private Date birthday;

	/**
	 * 星座
	 */
	private String constellation;

	/**
	 * 生肖
	 */
	private String zodiac;

	/**
	 * 电话
	 */
	private String telephone;

	/**
	 * 手机
	 */
	private String mobile;

	/**
	 * 证件类型
	 */
	private IdCardType idCardType;

	/**
	 * 证件号
	 */
	private String idCard;

	/**
	 * 详细地址
	 */
	private String address;
	/**
	 * 邮编
	 */
	private String zipCode;

	/**
	 * 国籍
	 */
	private String nationality;

	/**
	 * 出生省份
	 */
	private String birthProvince;

	/**
	 * 出生城市
	 */
	private String birthCity;

	/**
	 * 居住省份
	 */
	private String resideProvince;
	/**
	 * 居住城市
	 */
	private String resideCity;
	/**
	 * 居住州县
	 */
	private String resideDist;
	/**
	 * 居住乡镇
	 */
	private String resideCommunity;
	/**
	 * 居住房间(小区，门牌号)
	 */
	private String resideSuite;

	/**
	 * 毕业学校
	 */
	private String graduateSchool;
	/**
	 * 学历
	 */
	private String education;
	/**
	 * 公司
	 */
	private String company;

	/**
	 * 职业
	 */
	private String occupation;
	/**
	 * 职位
	 */
	private String position;
	/**
	 * 年收入
	 */
	private String revenue;
	/**
	 * 情感状态
	 */
	private String affectiveStatus;
	/**
	 * 交友目的(希望在网站找到什么样的朋友)
	 */
	private String lookingFor;
	/**
	 * 血型
	 */
	private String bloodType;

	/**
	 * 身高(单位cm)
	 */
	private int height;
	/**
	 * 体重(单位kg)
	 */
	private int weight;
	/**
	 * 支付宝帐号
	 */
	private String alipay;

	/**
	 * icq帐号
	 */
	private String icq;

	/**
	 * QQ帐号
	 */
	private String qq;
	/**
	 * yahoo帐号
	 */
	private String yahoo;
	/**
	 * MSN帐号
	 */
	private String msn;
	/**
	 * 阿里旺旺帐号
	 */
	private String taobao;
	/**
	 * 自我介绍
	 */
	private String bio;
	/**
	 * 兴趣爱好
	 */
	private String interest;

	/**
	 * 个人主页
	 */
	private String site;

	/**
	 * 属性保密设定
	 */
	@Property
	private Map<String, PrivacyType> privacyOptions = new HashMap<String, PrivacyType>();

	/**
	 * @return the fullName
	 */
	public String getFullName() {
		return fullName;
	}

	/**
	 * @param fullName
	 *            the fullName to set
	 */
	public void setFullName(String fullName) {
		this.fullName = fullName;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public String getZipCode() {
		return zipCode;
	}

	public void setZipCode(String zip) {
		this.zipCode = zip;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Gender getGender() {
		return gender;
	}

	public void setGender(Gender gender) {
		this.gender = gender;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getConstellation() {
		return constellation;
	}

	public void setConstellation(String constellation) {
		this.constellation = constellation;
	}

	public String getZodiac() {
		return zodiac;
	}

	public void setZodiac(String zodiac) {
		this.zodiac = zodiac;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public IdCardType getIdCardType() {
		return idCardType;
	}

	public void setIdCardType(IdCardType idCardType) {
		this.idCardType = idCardType;
	}

	public String getIdCard() {
		return idCard;
	}

	public void setIdCard(String idCard) {
		this.idCard = idCard;
	}

	public String getNationality() {
		return nationality;
	}

	public void setNationality(String nationality) {
		this.nationality = nationality;
	}

	public String getBirthProvince() {
		return birthProvince;
	}

	public void setBirthProvince(String birthProvince) {
		this.birthProvince = birthProvince;
	}

	public String getBirthCity() {
		return birthCity;
	}

	public void setBirthCity(String birthCity) {
		this.birthCity = birthCity;
	}

	public String getResideProvince() {
		return resideProvince;
	}

	public void setResideProvince(String resideProvince) {
		this.resideProvince = resideProvince;
	}

	public String getResideCity() {
		return resideCity;
	}

	public void setResideCity(String resideCity) {
		this.resideCity = resideCity;
	}

	public String getResideDist() {
		return resideDist;
	}

	public void setResideDist(String resideDist) {
		this.resideDist = resideDist;
	}

	public String getResideCommunity() {
		return resideCommunity;
	}

	public void setResideCommunity(String resideCommunity) {
		this.resideCommunity = resideCommunity;
	}

	public String getResideSuite() {
		return resideSuite;
	}

	public void setResideSuite(String resideSuite) {
		this.resideSuite = resideSuite;
	}

	public String getGraduateSchool() {
		return graduateSchool;
	}

	public void setGraduateSchool(String graduateSchool) {
		this.graduateSchool = graduateSchool;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

	public String getCompany() {
		return company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getOccupation() {
		return occupation;
	}

	public void setOccupation(String occupation) {
		this.occupation = occupation;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public String getRevenue() {
		return revenue;
	}

	public void setRevenue(String revenue) {
		this.revenue = revenue;
	}

	public String getAffectiveStatus() {
		return affectiveStatus;
	}

	public void setAffectiveStatus(String affectiveStatus) {
		this.affectiveStatus = affectiveStatus;
	}

	public String getLookingFor() {
		return lookingFor;
	}

	public void setLookingFor(String lookingfor) {
		this.lookingFor = lookingfor;
	}

	public String getBloodType() {
		return bloodType;
	}

	public void setBloodType(String bloodType) {
		this.bloodType = bloodType;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	public int getWeight() {
		return weight;
	}

	public void setWeight(int weight) {
		this.weight = weight;
	}

	public String getAlipay() {
		return alipay;
	}

	public void setAlipay(String alipay) {
		this.alipay = alipay;
	}

	public String getIcq() {
		return icq;
	}

	public void setIcq(String icq) {
		this.icq = icq;
	}

	public String getQq() {
		return qq;
	}

	public void setQq(String qq) {
		this.qq = qq;
	}

	public String getYahoo() {
		return yahoo;
	}

	public void setYahoo(String yahoo) {
		this.yahoo = yahoo;
	}

	public String getMsn() {
		return msn;
	}

	public void setMsn(String msn) {
		this.msn = msn;
	}

	public String getTaobao() {
		return taobao;
	}

	public void setTaobao(String taobao) {
		this.taobao = taobao;
	}

	public String getBio() {
		return bio;
	}

	public void setBio(String bio) {
		this.bio = bio;
	}

	public String getInterest() {
		return interest;
	}

	public void setInterest(String interest) {
		this.interest = interest;
	}

	public String getSite() {
		return site;
	}

	public void setSite(String site) {
		this.site = site;
	}

	public Map<String, PrivacyType> getPrivacyOptions() {
		return privacyOptions;
	}

	public void setPrivacyOptions(Map<String, PrivacyType> privacyOptions) {
		this.privacyOptions = privacyOptions;
	}

	public PrivacyType getPrivacyOption(String propName) {
		return privacyOptions.get(propName);
	}

	public void addPrivacyOption(String propName, PrivacyType privacyType)
			throws IllegalArgumentException {
		if (ReflectionUtils.getDeclaredField(this.getClass(), propName) == null) {
			throw new IllegalArgumentException("UserProfile类不存在此属性:" + propName);
		}
		privacyOptions.put(propName, privacyType);
	}

	public void addPrivacyOption(String propName, String privacyValue)
			throws IllegalArgumentException {
		PrivacyType privacyType = PrivacyType.valueOf(privacyValue);
		addPrivacyOption(propName, privacyType);
	}

	public void removePrivacyOption(String propName) {
		privacyOptions.remove(propName);
	}

}
